import {Pipe, PipeTransform} from "@angular/core";

/**
 * Created by Administrator on 2017/3/28.
 */
@Pipe({name: 'fillPlanType'})
export class FillPlanType implements PipeTransform {
    transform(value: any): string {
        let result = "-"
        switch (value) {
            case 'stopped':
                result = '<span class="label label-danger">已停止</span>';
                break;
            case 'running':
                result = '<span class="label label-success">运行中</span>';
                break;
            default:
                result = '<span class="label label-danger">未知</span>';
                break;
        }

        return result
    }


    types: any = [
        {name: "已停止", value: 1},
        {name: "运行中", value: 0}
    ]


    getTypes(): any {
        return this.types
    }
}